<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class user_library
{
	public function __construct()
    {
        if (!isset($this->CI))
        {
            $this->CI =& get_instance();
        }
    }
	
	public function userinfo($user)
	{
		$data['mid'] = $user['member_id'] ;
		$data['username'] = $user['username'] ;
		$data['fullname'] = $user['fullname'] ;
		$data['email'] = $user['lb_email'] ;
		$data['phone'] = $user['nb_phone'] ;
		$data['address'] = $user['address'] ;
		$data['user_ip'] = $user['user_ip'] ;
		$data['dt_create'] = $user['dt_create'] ;
		$data['dt_login'] = $user['dt_login'] ;
		
		return $data ;
	}
	
	public function get_day_of_birthday($birthday='')
	{
		$arr = explode('/', $birthday) ; 
		return $arr[0] ;
	}
	
	public function get_month_of_birthday($birthday='')
	{
		$arr = explode('/', $birthday) ;
		$arr[1] = isset($arr[1]) ? $arr[1] : 0 ;
		return $arr[1] ;
	}
	
	public function get_year_of_birthday($birthday='')
	{
		$arr = explode('/', $birthday) ;
		$arr[2] = isset($arr[2]) ? $arr[2] : 0 ;
		return $arr[2] ;
	}
}